{include file='../Public/header.tpl'}
<link href="/Public/Home/css/index.css" rel="stylesheet" type="text/css" media="screen"/>
<script src="/Public/jquery.js"></script>
<script>
	$(function(){
		$('#Go').on('click',function(){
			var url='/index.php/Home/Index/ajaxsort';
			var data={
				'sort':$('#sort').val(),
				'order':$('#order').val()
			};
			$.post(url,data,function(msg){
				$('#productlist').empty();
				var str='';
				for(var i=0 ; i<msg.length;i++){
					str+='<li><a href="/index.php/Home/Index/goods/id/'+msg[i].id+'">';
					str+='<img style="height:100px" src="/Public/Admin/Upload/'+msg[i].photo+'" alt="'+msg[i].name+'" />';
					str+='</a><p class="pname"><a href="/index.php/Home/Index/goods/id/'+msg[i].id+'" title="'+msg[i].name+'">'+msg[i].name;
					str+='</a></p><p class="price">￥'+msg[i].price+'</p></li>';
				}
				$('#productlist').html(str);
			},'json');
		});
	});
</script>
 <div id="body">
        <div class="body_l">
            <div class="subsearch">
                <form id="searchForm" name="searchForm" method="get" action="search.php"
                onSubmit="return checkSearchForm()">
                    <div>
                        <input name="keywords" type="text" id="keyword" value="" class="searchmobile">
                        <button class="menu_button" name="menu_button" onClick="return checkSearchForm()">
                        </button>
                    </div>
                </form>
            </div>
            <script type="text/javascript">
                <!--
                function checkSearchForm() {
                    if (document.getElementById('keyword').value) {
                        document.searchForm.submit();
                        return true;
                    } else {
                        alert("请输入搜索关键词！");
                        return false;
                    }
                }
                -->
            </script>
            <div class="subnav_header">
            </div>
            <div class="subnav">

{foreach from=$cateData item=val}
{if $val.pid eq "0"}

                <div>
                    <span class="left">
{$val.name}
                    </span>
                    <span class="right subnav_right">
                        <img src="/Public/Home/images/line.gif" border="0" id="categorie_ico3">
                    </span>
                </div>
{else}
                <ul id="m3" style="display:block">
                    <li>
                        &nbsp;
                        <a href="/index.php/Home/Index/cate/id/{$val.id}">
{$val.name}
                        </a>
                    </li>
                </ul>
{/if}
{/foreach}
            </div>
<!---------------------------热销榜--------------------------------->
            <div class="subinfo_header">
                <div class="subinfo_header_left_top10">
                    &nbsp;
                    <a href="#">
                    </a>
                </div>
            </div>
            <div class="subinfo_body_top10">
                <ul>

{foreach from=$hotgoodsData item=val}
                   <li>
                        <div class="subinfo_body_top10_l">
                            <a href="/index.php/Home/Index/goods/id/{$val.id}">
                                <img src="/Public/Admin/upload/{$val.photo}" alt=""
                                class="samllimg" />
                            </a>
                        </div>
                        <div class="subinfo_body_top10_r">
                            <p class="subinfo_body_top10_r_1">
                                <a href="/index.php/Home/Index/goods/id/{$val.id}" title="{$val.brief}">
                                    {$val.name}
                                </a>
                            </p>
                            <p class="subinfo_body_top10_r_2">
                                <a href="#">
                                </a>
                            </p>
                            <p class="subinfo_body_top10_r_3">
                                ￥{$val.price}元
                            </p>
                        </div>
                        <div class="clear">
                        </div>
                    </li>
{/foreach}
                </ul>
            </div>
            <div class="subinfo_footer">
            </div>
        </div>
        <div class="body_brand_r">
            <div style="height:8px">
            </div>
            <div class="type_nav">
                <ul>
                    <li class="type_nav_li1" onClick="location.href='category.php?id=19'">
                        <a href="#">
                            音乐手机
                        </a>
                    </li>
                    <li onClick="location.href='category.php?id=20'" class="type_nav_li2">
                        <a href="#">
                            GPS导航手机
                        </a>
                    </li>
                    <li onClick="location.href='category.php?id=5'" class="type_nav_li3">
                        <a href="#">
                            超长待机
                        </a>
                    </li>
                    <li onClick="location.href='category.php?id=2'" class="type_nav_li4">
                        <a href="#">
                            电视手机
                        </a>
                    </li>
                    <li onClick="location.href='category.php?id=18'" class="type_nav_li5">
                        <a href="#">
                            拍照手机
                        </a>
                    </li>
                    <li onClick="location.href='category.php?id=16'" class="type_nav_li6">
                        <a href="#">
                            双卡手机
                        </a>
                    </li>
                    <li onClick="location.href='category.php?id=4'" class="type_nav_li7">
                        <a href="#">
                            大屏手写手机
                        </a>
                    </li>
                    <li onClick="location.href='category.php?id=3'" class="type_nav_li8">
                        <a href="#">
                            智能手机
                        </a>
                    </li>
                    <li onClick="location.href='category.php?id=17'" class="type_nav_li9">
                        <a href="#">
                            游戏手机
                        </a>
                    </li>
                </ul>
                <div class="clear">
                </div>
            </div>
            <div class="pagelist">
                    显示方式：
                    <select name="sort" id='sort' style="border:1px solid #ccc;">
                        <option value="id" selected>
                            按上架时间排序
                        </option>
                        <option value="price">
                            按价格排序
                        </option>
                        <option value="ctime">
                            按更新时间排序
                        </option>
                    </select>
                    <select name="order" id='order' style="border:1px solid #ccc;">
                        <option value="DESC" selected>
                            倒序
                        </option>
                        <option value="ASC">
                            正序
                        </option>
                    </select>
                    <input type="button" id='Go' value="Go" />
            </div>
            <div class="page_header">
                <form name="selectPageForm" action="/shouji/category.php" method="get">
                    <div id="page" class="pagebar">
                        <span class="f_l f6" style="margin-right:10px;">
                            总计
                            <b>
                                12
                            </b>
                            个记录
                        </span>
                        <span class="page_now">
                            1
                        </span>
                        <a href="#">
                            [2]
                        </a>
                        <a class="next" href="#">
                            下一页
                        </a>
                    </div>
                </form>
                <script type="Text/Javascript" language="JavaScript">
                    <!--
                    function selectPage(sel) {
                        sel.form.submit();
                    }
                    //-->
                    
                </script>
            </div>
            <ul id='productlist' class="productlist">

{foreach from=$goodslistData item=val}
                <li>
                    <a href="/index.php/Home/Index/goods/id/{$val.id}">
                        <img style="height:100px" src="/Public/Admin/Upload/{$val.photo}" alt="{$val.name}" />
                    </a>
                    <p class="pname">
                        <a href="/index.php/Home/Index/goods/id/{$val.id}" title="{$val.name}">
                            {$val.name}
                        </a>
                    </p>
                    <p class="price">
                        ￥{$val.price}元
                    </p>
                </li>
{/foreach}
            </ul>
            <div class="clear"></div>
            <div class="page_footer">
                <form name="selectPageForm" action="/shouji/category.php" method="get">
                    <div id="page" class="pagebar">
                        {$pagestr}
                    </div>
                </form>
                <script type="text/Javascript">
                    function selectPage(sel) {
                        sel.form.submit();
                    }
                </script>
                <div class="clear">
                </div>
            </div>
        </div>
        <div class="clear">
        </div>
    </div>

{include file='../Public/footer.tpl'}
